package mysql

import (
	"gorm.io/gorm"
)

type Order struct {
	gorm.Model
	GoodsId int     `gorm:"type:int;not null;comment:商品id"`
	OrderSn string  `gorm:"type:varchar(20);not null;comment:订单编号"`
	PayUrl  string  `gorm:"type:varchar(100);not null;comment:支付链接"`
	Amount  float64 `gorm:"type:decimal(10,2);not null;comment:订单金额"`
}

func (o *Order) AddOrder() error {
	return Db.Create(&o).Error
}
